package org.batatasframework.immadiate;

import cn.bonoon.entities.ImmediatePlanEntity;
import cn.bonoon.entities.ImmediateTaskEntity;
import cn.bonoon.kernel.util.StringHelper;

public class ImmediateTaskInfo {
	private final Long id;
	private final String name;
	private final String key;
	private final String startAt;
	private final String endAt;
	private final String remark;
	
	public ImmediateTaskInfo(ImmediateTaskEntity task){
		ImmediatePlanEntity plan = task.getPlan();
		this.id = task.getId();
		this.endAt = StringHelper.datetime2String(task.getEndAt());
		
		this.name = plan.getName();
		this.key = plan.getKey();
		this.startAt = StringHelper.datetime2String(plan.getStartAt());
		this.remark = plan.getRemark();
	}
	
	public ImmediateTaskInfo(ImmediatePlanEntity plan){
		this.id = plan.getId();
		this.endAt = StringHelper.datetime2String(plan.getEndAt());
		
		this.name = plan.getName();
		this.key = plan.getKey();
		this.startAt = StringHelper.datetime2String(plan.getStartAt());
		this.remark = plan.getRemark();
	}

	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public String getKey() {
		return key;
	}

	public String getStartAt() {
		return startAt;
	}

	public String getEndAt() {
		return endAt;
	}

	public String getRemark() {
		return remark;
	}
}
